#include<iostream>
using namespace std;
int main(){
	int n,m,t,a,b;
	scanf("%d%d",&m,&n);
	if(n>m){
		t=n;
		n=m;
		m=t;
	}
	a=m;
	b=n;
	while(n){
		t=n;
		n=m%n;
		m=t;
	}
	printf("%d\n%d\n",m,a*b/m);
	return 0;
}
